package com.gmq.chapter02.synLockIn_2;

/**
 * Created by gmq on 2017/08/22.
 *
 * @version 1.0
 * @since 2017/08/22 17:03
 */
public class Sub extends Main {

    synchronized public void opreateSubMethod() {
        try {
            while (i > 0) {
                i--;
                System.out.println("sub print i=" + i);
                Thread.sleep(100);
                this.operateMainMethod();
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}
